package com.lejin.controller;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "",//消费者组名称
topic = "",
selectorExpression = "",
consumeMode = ConsumeMode.CONCURRENTLY,//消费类型  非顺序消费
messageModel = MessageModel.BROADCASTING)//消息类型 广播
public class ConsumerListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        System.out.println(s);
    }
}
